package com.lu.sb210207.controller;


import com.lu.sb210207.entity.ScheduleTrigger;
import com.lu.sb210207.mapper.ScheduleTriggerMapper;
import com.lu.sb210207.result.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("quartzTrigger")
public class ScheduleTriggerController {

    @Autowired
    private ScheduleTriggerMapper scheduleTriggerMapper;

    @PostMapping("get")
    public Object getJob() {

        List<ScheduleTrigger> scheduleTriggers = scheduleTriggerMapper.queryScheduleTrigger();

        return JsonResult.builder().code(200).msg("查询成功！").data(scheduleTriggers).build();
    }

}
